// const express = require('express')
// const cors = require('cors')
// const lodash = require('lodash')
// const { stuNameArr } = require('./stuName.js')
// const server = express()
// server.use(cors())

// server.get('/api/rand', (req, res) => {
//   const rand = lodash.random(0, 10)
//   const stuName = stuNameArr[rand]

//   res.send(stuName)
// })

// server.listen(3200, () => {
//   console.log('Web 服务启动了')
// })



// const express = require('express')
// const cors = require('cors')
// const lodash = require('lodash')
// const server = express()
// server.use(cors())
// const {stuNameArr} = require('./stuName.js')

// server.get('/api/rand',(req,res)=>{
//   const rand = lodash.random(0, 10)
//   const stuName = stuNameArr[rand]
//   res.send(stuName)
// })

// server.listen(3820, () => {
//   console.log('Web 服务已启动')
// })

const express = require('express')
const cors = require('cors')
const lodash = require('lodash')
const server = express()
server.use(cors())
const {stuNameArr} = require('./stuName.js')
server.get('/api/rand',(req,res)=>{
  const rand = lodash.random(0,10)
  const stuName = stuNameArr[rand]
  res.send(stuName)
})
server.listen(4000,()=>{
  console.log('已经启动')
})